<template>
  <div class="v-header">
    <!-- 商家信息 -->
    <div class="header-wrapper">
      <div class="avatar">
        <img :src="seller.avatar" width="64" height="64" />
      </div>
      <div class="content">
        <div class="title">
          <span class="brand"></span>
          <span class="name">{{ seller.name }}</span>
        </div>
        <div class="description">
          {{ seller.description }}/{{ seller.deliveryTime }}分钟送达
        </div>
        <div class="support-wrapper" v-if="seller.supports">
          <support-ico :size=1 :type="seller.supports[0].type"></support-ico>
          <span class="text">{{ seller.supports[0].description }}</span>
        </div>
      </div>
      <!-- 优惠数量 -->
      <div class="support-num" v-if="seller.supports">
        <span class="num">{{ seller.supports.length }}</span>
        <i class="icon-keyboard_arrow_right"></i>
      </div>
    </div>
    <!-- 商家公告 -->
    <div class="bulletin-wrapper">
      <span class="bulletin-icon"></span>
      <span class="bulletin-text">{{ seller.bulletin }}</span>
      <i class="icon-keyboard_arrow_right"></i>
    </div>
    <!-- 头部背景 -->
    <div class="brackground">
      <img :src="seller.avatar" width="100%" height="100%" />
    </div>
    <!-- 弹出层 -->
  </div>
</template>

<script>
import SupportIco from 'components/support-ico/support-ico'
export default {
  name: 'v-header',
  props: {
    seller: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  components: {
    SupportIco
  }
}
</script>

<style lang="stylus" scoped>
@import '../../common/stylus/variable.styl'
@import '../../common/stylus/mixin.styl'

.v-header
  position relative
  background-color $color-background-ss
  color $color-white

  .header-wrapper
    position relative
    padding 24px 12px 28px 24px

    .avatar
      display inline-block
      margin-right 16px
      height 64px
      width 64px
      border-radius 2px
      overflow hidden
      vertical-align top

    .content
      display inline-block
      vertical-align top

      .title
        margin 2px 0px 8px 0px

        .brand
          display inline-block
          margin-right 12px
          width 30px
          height 18px
          bg-image brand
          background-size 30px 18px
          background-repeat no-repeat
          vertical-align top

        .name
          font-size 16px
          font-weight bold
          vertical-align top

      .description
        margin-bottom 10px
        font-size 12px

      .support-wrapper
        margin-bottom 2px

        .support-ico
          display inline-block
          height 12px
          width 12px

        .text
          font-size 10px
          margin-left 4px
          vertical-align top

  .support-num
    position absolute
    top 67px
    right 12px
    padding 7px 8px
    border-radius 12px
    font-size 10px
    background-color $color-background-sss

  .bulletin-wrapper
    position relative
    height 28px
    line-height 28px
    padding 0px 22px 0px 12px
    background-color $color-background-sss
    overflow hidden
    text-overflow ellipsis
    white-space nowrap

    .bulletin-icon
      display inline-block
      margin 8px 4px 0px 0px
      height 12px
      width 22px
      bg-image bulletin
      background-size 22px 12px
      background-repeat no-repeat
      vertical-align top

    .bulletin-text
      font-size 10px
      vertical-align top

    .icon-keyboard_arrow_right
      position absolute
      top 8px
      right 12px
      font-size 10px

  .brackground
    position absolute
    top 0
    bottom 0
    z-index -1
    filter blur(10px)
    height 100%
    width 100%
</style>